package fruit;

import java.util.ArrayList;

class Fruit{
    private String name;
    public Fruit(String name){
        this.name = name;
    }
    public String toString() {
        return name+"-"+super.toString();
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((name == null) ? 0 : name.hashCode());
        return result;
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (getClass() != obj.getClass())
            return false;
        Fruit other = (Fruit) obj;
        if (name == null) {
            if (other.name != null)
                return false;
        } else if (!name.equalsIgnoreCase(other.name))
            return false;
        return true;
    }
    
}

public class Main1 {

    public static void main(String[] args) {
    	 ArrayList<Fruit> fruitList = new ArrayList<Fruit>();
         Fruit[] fruit = new Fruit[7];
         fruit[0] = new Fruit("apple");
         fruit[1] = new Fruit("APPLE");
         fruit[2] = new Fruit("apPle");
         fruit[3] = new Fruit("Apple");
         fruit[4] = new Fruit("orange");
         fruit[5] = new Fruit("Strawberry");
         fruit[6] = new Fruit("Orange");
         
         for(int i=0;i<fruit.length;i++){
             if(fruitList.contains(fruit[i])==false)
                 fruitList.add(fruit[i]);
         }
         for(int i=0;i<fruitList.size();i++)
             System.out.println(fruitList.get(i));
     }

    }
